import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/4/16 17:50
 * 数据库连接池
 * mkdir
 */
public class Day37 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int num =Integer.parseInt(scanner.nextLine());

            String[] list = new String[num];
            for (int i = 0; i < num; i++) {
                list[i] = scanner.nextLine();
            }
            Arrays.sort(list);

            for (int i = 1; i < list.length; i++) {
                if (list[i].contains(list[i-1]) && list[i].charAt(list[i-1].length())=='/'){
                    list[i-1]="";
                }
            }
            for (int i = 0; i < list.length; i++) {
                if ( !"".equals(list[i])){
                    System.out.println("mkdir -p "+list[i]);
                }
            }
            System.out.println();
        }
    }
    //---------------------------------------
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int num = scanner.nextInt();

            int max = 0;
            int size = 0;
            while (num != 0) {
                String id = scanner.next();
                String op = scanner.next();
                if (op.equals("connect")) {
                    size++;
                    max = Math.max(size, max);
                } else if (op.equals("disconnect")) {
                    size--;
                }
                num--;
            }
            System.out.println(max);
        }
    }

}

